Repository navigation
fix(agc): start a new native multisample depth owner when an overwriting draw binds a published owner under pending storage units - #17890
Conversation
# Conflicts: # core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake # core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
# Conflicts: # core/libs/prx/libSceAgcDriver/Graphics/src/DepthSurface.cpp # core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_native_multisample_depth_tests.cmake # core/libs/prx/libSceAgcDriver/tests/execution/NativeMultisampleDepth.cpp
…ing draw binds a published owner under pending storage units
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
An NVIDIA run, since the PR has AMD and lavapipe results only: RTX 3070 (8 GB), driver 610.57.04, Debian 13, kernel 6.12.115, GCC 13.3.0 Release, validation layer 1.4.335,
AI-assisted: yes |
|
@Doorriiaann Thanks for the NVIDIA run. It's also the first run where |
|
Windows GPU check of head Setup: Windows 11 Enterprise 22621, AMD Radeon RX 6700 XT (driver 32.0.21045.16010), WinLibs GCC 15.2 UCRT, Release, These five tests pass in 3 of 3 runs each, 15 of 15, none skipped:
All 408 test and AI-assisted: yes. |
|
@JJenkx Thanks for the Windows run. It's the first on Windows and on an RDNA2 card. I've added it to Tested. |
|
#16363 and #16365 are merged, so I merged
The diff against With the validation layer, the same command as before (73 tests): 71 pass, |
|
#16364 is merged, so I merged With the validation layer, the same command as before (73 tests): 71 pass, |
|
Ran this PR merged onto
Failures
|
|
@Lucke0051 Thanks, and for the first Intel run on this one. No difference from |
Validation run — queue item 38 (AGC multisample depth owner / published owner under pending storage units)Environment
Build
Focused test pattern
Test runs (identical env on both trees,
|
What
Assassin's Creed Mirage (PPSA13960) stops before its title screen, at 73-81 s:
The target is a 4-sample D32S8 depth target without HTILE (960x540 in our logs). #16363's overwrite proof imports it, and its samples are then published to guest memory. After that the host doesn't write it. A compute pass then writes an R11G11B10F storage image at the same base, so storage units stay pending over the depth plane. The next frame binds the target again with a draw that writes every sample (depth ALWAYS with writes, stencil ALWAYS/REPLACE, mask 0xff). That bind finds the published owner and reuses it. Once the draw writes the owner, its next publication meets the pending units and throws the message above.
On the console the target and the storage image are the same memory, and that draw overwrites every sample. So no sample of the old owner survives, and the storage results are just the memory under the new draw.
The change.
DepthSurfaceViewWithStencilWriteIntentnow starts a new owner when all three of these hold:overwrittenStencil);GuestHoldsSamples);StorageTexture::AnyPendingUnitsOverlap).The old owner is marked inactive and its depth guards are removed. It isn't host-written, so
releaseRetired(#15300) frees it when the new owner is created. The new owner imports guest memory as any new owner does, and its import stores the pending results first. Its planes are then uneven, so #16363's proof decides after the draw, as for any other overwriting first draw.Nothing else changes:
The depth surface debt entry, which lists when a published owner is released and a new one imported, now names this case too.
Cost: one new owner per such bind, so one overwrite proof (#16363: a recorder sync and a stencil readback). The released owner is freed at once (#15300). In Mirage (two 300 s runs of a local logging build), this path starts a new owner in two bursts, for 960x540 x4 targets, and never between them:
0x10db960000) at 50-70 s, around where the build without this change stops;0x10dfd20000). That is about one new owner per presented frame (12 new owners against 12 presents in each of two 10 s windows).The title screen and the menu (70-255 s) start none, and they run at 0.6-2 presents per second either way. The opening scene runs at 1.1-2.6 presents per second. The build without this change stops before that point, so this cost cannot be compared directly. Device VRAM in use stays at 12.4-12.7 GB from 75 s to the end of every run with this change, with no growth.
Tested
Linux 7.2.14, AMD Radeon RX 9070 XT, RADV (Mesa 26.2.6), Release with tests.
agc_driver_native_depth_overwritten_published(--overwritten-published), at 2, 4 and 8 samples, on a 200x130 D32S8 target without HTILE over uniform planes. The owner is imported, drawn and published by a guest read. Then a linear storage image is cleared over its depth plane from 64 KiB in, and its results are left pending. Then one of:native multisample depth publication over pending storage image writes is not implemented;main6719b01 + fix(agc): import a native multisample D32S8 target over uneven planes once its first draw wrote every sample #16363 + fix(agc): publish native multisample depth next to a storage image whose pending units lie past its planes #16364 + fix(agc): leave a single-sample view over a published native multisample depth owner to guest memory #16365, test only) fails at each sample count withAGC graphics: an overwriting draw over a published owner under storage results did not start a new owner. The first case is the unchanged behaviour, so it passes there too. It runs first in each sample count, so the log shows the base behaviour before the failure.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1,ctest -V -R "native_depth|native_multisample|depth_storage|depth_surface|agc_storage_|multisample_guest|repeat_storage_guard|cached_image|storage_flush_ordering|storage_one_slice|storage_read_during|storage_write_back|msaa_address_on_plane"):main6719b01 + fix(agc): import a native multisample D32S8 target over uneven planes once its first draw wrote every sample #16363 + fix(agc): publish native multisample depth next to a storage image whose pending units lie past its planes #16364 + fix(agc): leave a single-sample view over a published native multisample depth owner to guest memory #16365): 66 tests, 64 pass, 2 skip;agc_storage_pending_key_refreshandagc_storage_clear_hand_over. The loader inserted the layer in both runs. Neither log has aVUID-line, a validation warning, or "was not found but was requested".tools/check_conventions.py --base 6719b01bf3: passes (exit 0, no findings).main. The head,3b3fefa541, is this change withmainf439f7f merged in (a clean merge, with this PR's lines unchanged). It builds, and the same validation command, run withoutagc_storage_write_back_scratch, gives 66 tests: 64 pass, the same 2 skip, and the new test is among the passes. No log has aVUID-line, andcheck_conventionspasses.ctest -V -Rpattern above, 3 runs on each side.mainf439f7f: 63 tests, all pass 3 of 3.3b3fefa541: 67 tests, all pass 3 of 3. That includesagc_storage_pending_key_refreshandagc_storage_clear_hand_over, which skip on the RX 9070 XT, andagc_storage_write_back_scratch. The new test runs at 2, 4 and 8 samples.VUID-line, and the layer was found.57f21b13b8: fails 3 of 3 withan overwriting draw over a published owner under storage results did not start a new owner.3b3fefa541merged ontomaine7c3bfd, a clean merge. Windows 11 Enterprise 22621, AMD Radeon RX 6700 XT (driver 32.0.21045.16010), WinLibs GCC 15.2 UCRT, Release.agc_driver_native_multisample_depth,agc_driver_native_depth_pending_units,agc_driver_native_depth_overwritten_planes,agc_driver_native_depth_overwritten_publishedandagc_driver_native_depth_single_sample_viewpass 3 of 3 each, none skipped.08ba519102merged ontomain1ee5cd7, CachyOS (Linux 7.3.1), GCC 16.2.1, Release, compared withmainon the same machine,ctest -R '^(agc|video_out|shader)'. On an RTX 3070 Ti (NVIDIA 615.78.08) and an Intel UHD Graphics 630 (Mesa 26.2.6, ANV): no difference frommain, andagc_driver_native_depth_overwritten_publishedpasses 3 of 3 alone. No validation layer there.VUID-line). That still holds when the test's storage access passesDepthReadCause::Reuse, as fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941'scachedStorageTexturedoes. With thatReuseaccess, fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 without this change (the test only) fails as the base does:AGC graphics: an overwriting draw over a published owner under storage results did not start a new owner.Reuseaccess only when that access's publication took a guest byte. A published owner has nothing left to publish there, so it is kept, and the bind reaches this change as it does without fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941. When aReusepublication does take a guest byte, fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 retires the owner, and the next bind already creates a new owner without this change.PublishToGuest's declaration andRequireNoResidentDepthRead_nid_no_patch's signature) and in the publication debt entry. Those are the same conflicts as merging fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 onto those PRs alone.main6719b01 + fix(agc): store storage results pending under a multisampled color target before it takes the memory #13963 (97f05cb) + fix(agc): import a native multisample D32S8 target over uneven planes once its first draw wrote every sample #16363 + fix(agc): publish native multisample depth next to a storage image whose pending units lie past its planes #16364 + fix(agc): leave a single-sample view over a published native multisample depth owner to guest memory #16365:main6b58dfa + fix(agc): store storage results pending under a multisampled color target before it takes the memory #13963 + fix(agc): publish native multisample depth next to a storage image whose pending units lie past its planes #16364 + fix(agc): import a native multisample D32S8 target over uneven planes once its first draw wrote every sample #16363 + fix(agc): leave a single-sample view over a published native multisample depth owner to guest memory #16365 + fix(agc): publish a reused native multisample depth target with the guest's undecided bytes, then retire its owner #15941 (d4583e9) + fix(libSceAjm.native): stop checking sceAjmInitialize's reserved #16974 (since merged), 720 s each, recomputed from their logs:a native multisample depth attachment over the planes of a host-written owner of another identity is not implementedat 448 s and 573 s;initial multisample color contents overlap resident native depthat 515 s and 454 s;a storage image access ... overlaps multisampled color target ... whose samples are only on the hostat 455 s;Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)